package com.service;

import org.apache.log4j.Logger;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import com.util.RestCallManager;
import com.icim.service.ICIMBaseService;

@Scope("prototype")
@Service("SendMsgService")
public class SendMsgService extends ICIMBaseService{
	private static Logger logger = Logger.getLogger(SendMsgService.class);

	public String sendWithRepaly(String strInMsg) {
		int index = strInMsg.indexOf("<trx_id>");
		if (index == -1) {
			return "the xml not have trx_id property";
		}
		String appName = strInMsg.substring(index + 8, index + 16) + "I";
		logger.info("Send ->" + strInMsg);
		String strOutMsg = RestCallManager.sendMessage(appName, strInMsg);
		logger.info("Recive ->" + strOutMsg);
		return strOutMsg;
	}

	public String subMainProc(String arg0) {
		// TODO Auto-generated method stub
		return null;
	}
}
